<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<c:if test="${pg.pageCount > 1}">
<div class="pagination pagination-right pagination-small">
  <ul>
   	<c:choose>
	       <c:when test="${pg.pageNumber != 1}">
	       		<li><a href="javascript:jumpPage(1);" title="首页">首页</a></li>
	       </c:when>
	       <c:otherwise>
	       		<li class="disabled"><a href="javascript:void(0);" title="首页">首页</a></li>
	       </c:otherwise>
	</c:choose>
	<c:choose>
	       <c:when test="${pg.hasPre}">
	       		<li><a href="javascript:jumpPage(${pg.prePage});" title="上一页">上一页</a></li>
	       </c:when>
	       <c:otherwise>
	       		<li class="disabled"><a href="javascript:void(0);" title="上一页">上一页</a></li>
	       </c:otherwise>
	</c:choose>
	<c:choose>
	       <c:when test="${pg.hasNext}">
	       		<li><a href="javascript:jumpPage(${pg.nextPage});" title="下一页">下一页</a></li>
	       </c:when>
	       <c:otherwise>
	       		<li class="disabled"><a href="javascript:void(0);" title="下一页">下一页</a></li>
	       </c:otherwise>
	</c:choose>
	<c:choose>
	       <c:when test="${pg.pageNumber != pg.pageCount}">
	       		<li><a href="javascript:jumpPage(${pg.pageCount});" title="末页">末页</a></li>
	       </c:when>
	       <c:otherwise>
	       		<li class="disabled"><a href="javascript:void(0);" title="末页">末页</a></li>
	       </c:otherwise>
	</c:choose>
  	<li class="disabled"><a href="javascript:;">${pg.pageNumber}/${pg.pageCount}页 | 每页${pg.pageSize}条 | 共${pg.recordCount}条记录</a></li>
  	<li class="disabled pull-left">
  		<span style="padding:2px 10px;height:20px;line-height:20px;">
  		<input type="text" id="goPage" placeholder="" style="width:48px;height:16px;line-height:16px;font-size:12px;padding:0;margin:0;"/>
  		</span>
  	</li>
  	<li><a href="javascript:goPage()">GO</a></li>
  </ul>
</div>
<script type="text/javascript">
function goPage() {
	var page = $("#goPage").val();
	try {
		if (isNaN(page)) {
			badPageNumber();
		} else {
			if( (0 < page) && (page <=　${pg.pageCount}) ){
				jumpPage(page);
			}else{
				badPageNumber();
			}
		}
	} catch (e) {
		badPageNumber();
	}
}

function badPageNumber(){
	//$("#goPage").css({"background-color":"#c09853","border":"1px solid red"});
	$("#goPage").css({"color":"#c09853","border":"1px solid #c09853"});
	setTimeout(function(){
		//$("#goPage").css({"color":"#333","border":"1px solid #cccccc"});
	},800);
}
</script>
</c:if>